<?php
require "connect_database.php";

$username = '';
$password = '';

if(isset($_POST['username'])){ $username = $_POST['username']; }
if(isset($_POST['password'])){ $password = $_POST['password']; }

$sql_login = "SELECT * FROM agent WHERE `agent_username`='$username' AND `agent_password`='$password'";
$sql_login_result = mysqli_query($connect, $sql_login);

if(mysqli_num_rows($sql_login_result) == 0)
{
	echo "invalid";
}
elseif(mysqli_num_rows($sql_login_result) != 0)
{
	$fetch_data = mysqli_fetch_array($sql_login_result);
	$agent_name = $fetch_data ['agent_name'];
	echo "valid:$agent_name";
}

?>